# Copyright 2009 RedHat Inc. All rights reserved.
# Use is subject to license terms.
#
# Description:    Constants definitions for vdsm and utilities.

#
# Path definitions
#
P_BIN = '/bin/'
P_SBIN = '/sbin/'
P_USR_BIN = '/usr/bin/'
P_USR_SBIN = '/usr/sbin/'
P_VDSM = '@VDSMDIR@/'
P_VDSM_RUN = '@VDSMRUNDIR@/'

P_VDSM_CLIENT_LOG = '@VDSMRUNDIR@/client.log'

#
# External programs (sorted, please keep in order).
#
EXT_ADDNETWORK = P_VDSM + 'addNetwork'
EXT_AWK = P_BIN + 'awk'

EXT_BLOCKDEV = P_SBIN + 'blockdev'
EXT_BRCTL = P_USR_SBIN + 'brctl'

EXT_CAT = P_BIN + 'cat'
EXT_CHMOD = P_BIN + 'chmod'
EXT_CHOWN = P_BIN + 'chown'
EXT_CP = P_BIN + 'cp'

EXT_DD = P_BIN + 'dd'
EXT_DELNETWORK = P_VDSM + 'delNetwork'
EXT_DMIDECODE = P_USR_SBIN + 'dmidecode'
EXT_DMSETUP = P_SBIN + 'dmsetup'

EXT_ETHTOOL = P_SBIN + 'ethtool'
EXT_EDITNETWORK = P_VDSM + 'editNetwork'

EXT_FENCE_PREFIX = P_USR_SBIN + 'fence_'
EXT_FSCK = P_SBIN + 'e2fsck'
EXT_FUSER = P_SBIN + 'fuser'

EXT_HEAD = P_USR_BIN + 'head'

EXT_IFCONFIG = P_SBIN + 'ifconfig'
EXT_IFDOWN = P_SBIN + 'ifdown'
EXT_IFUP = P_SBIN + 'ifup'
EXT_IONICE = P_USR_BIN + 'ionice'
EXT_IP = P_SBIN + 'ip'
EXT_IPCALC = P_BIN + 'ipcalc'
EXT_ISCSIADM = P_SBIN + 'iscsiadm'

EXT_KILLALL = P_USR_BIN + 'killall'

EXT_LVCHANGE = P_USR_SBIN + 'lvchange'
EXT_LVCREATE = P_USR_SBIN + 'lvcreate'
EXT_LVEXTEND = P_USR_SBIN + 'lvextend'
EXT_LVREMOVE = P_USR_SBIN + 'lvremove'
EXT_LVRENAME = P_USR_SBIN + 'lvrename'
EXT_LVSCAN   = P_USR_SBIN + 'lvscan'
EXT_LVS = P_USR_SBIN + 'lvs'

EXT_MKFS = P_SBIN + 'mke2fs'
EXT_MOUNT = P_BIN + 'mount'
EXT_MULTIPATH = P_SBIN + 'multipath'
EXT_MV = P_BIN + 'mv'

EXT_NETSTAT = P_BIN + 'netstat'
EXT_NICE = P_BIN + 'nice'

EXT_PERSIST = P_USR_SBIN + 'persist'
EXT_PGREP = P_USR_BIN + 'pgrep'
EXT_PING = P_BIN + 'ping'
EXT_PVCHANGE = P_USR_SBIN + 'pvchange'
EXT_PVCREATE = P_USR_SBIN + 'pvcreate'
EXT_PVS = P_USR_SBIN + 'pvs'
EXT_PYTHON = P_USR_BIN + 'python'

EXT_REBOOT = P_SBIN + 'reboot'
EXT_RPM = P_BIN + 'rpm'
EXT_RSYNC = P_USR_BIN + 'rsync'

EXT_SCSI_ID = P_SBIN + 'scsi_id' #TBD !
EXT_SERVICE = P_SBIN + 'service'
EXT_SETSID = P_USR_BIN + 'setsid'
EXT_SH = P_BIN + 'sh'
EXT_SHOWMOUNT = P_USR_SBIN + 'showmount'
EXT_SORT = P_BIN + 'sort'
EXT_SU = P_BIN + 'su'
EXT_SUDO = P_USR_BIN + 'sudo'

EXT_TAR = P_BIN + 'tar'
EXT_TOUCH = P_BIN + 'touch'
EXT_TRUE = P_BIN + 'true' #TBD
EXT_TUNCTL = P_USR_BIN + 'tunctl'
EXT_TUNE2FS = P_SBIN + 'tune2fs'

EXT_UDEVSETTLE = P_SBIN + 'udevsettle'
EXT_UMOUNT = P_BIN + 'umount'
EXT_UNPERSIST = P_USR_SBIN + 'unpersist'

EXT_VCONFIG = P_SBIN + 'vconfig'
EXT_VDSM_STORE_NET_CONFIG = P_VDSM + 'vdsm-store-net-config'
EXT_VGCFGBACKUP = P_USR_SBIN + 'vgcfgbackup'
EXT_VGCHANGE = P_USR_SBIN + 'vgchange'
EXT_VGCREATE = P_USR_SBIN + 'vgcreate'
EXT_VGEXTEND = P_USR_SBIN + 'vgextend'
EXT_VGMKNODES = P_USR_SBIN + 'vgmknodes'
EXT_VGREMOVE = P_USR_SBIN + 'vgremove'
EXT_VGRENAME = P_USR_SBIN + 'vgrename'
EXT_VGSCAN = P_USR_SBIN + 'vgscan'
EXT_VGS = P_USR_SBIN + 'vgs'

EXT_WGET = P_USR_BIN + 'wget'
EXT_WRITE_NET_CONFIG = P_VDSM + 'write-net-config'

#
# Storage constants
#
STRG_ISCSI_HOST = "iscsi_host:"
STRG_SCSI_HOST = "scsi_host:"
STRG_ISCSI_SESSION = "iscsi_session:"
STRG_ISCSI_CONNECION = "iscsi_connection:"
STRG_MPATH_CONF = """


defaults {
    udev_dir                /dev
    polling_interval        5
    selector                "round-robin 0"
    path_grouping_policy    multibus
    getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
    prio_callout            /bin/true
    path_checker            readsector0
    rr_min_io               100
    max_fds                 8192
    rr_weight               priorities
    failback                immediate
    no_path_retry           fail
    user_friendly_names     no
    flush_on_last_del       yes
    fast_io_fail_tmo        5
    dev_loss_tmo            30
}
"""


